Skip to content

feat: add Avian as LLM provider - #494

Open
avianion wants to merge 8 commits into
CodebuffAI:mainfrom
avianion:feat/add-avian-provider
Open

feat: add Avian as LLM provider#494
avianion wants to merge 8 commits into
CodebuffAI:mainfrom
avianion:feat/add-avian-provider

Conversation

@avianion

@avianion avianion commented Apr 4, 2026

Copy link
Copy Markdown

Summary

Register Avian model IDs and provider metadata so the codebase recognizes avian/* as valid model names.

Changes

  • Add avian/deepseek-v3.2, avian/kimi-k2.5, avian/glm-5, avian/minimax-m2.5 to the ModelName type (both copies)
  • Add avian to ALLOWED_MODEL_PREFIXES
  • Add avianModels constant, spread into models and providerModelNames
  • Add avian entry to providerDomains and getLogoForModel

What this does NOT include

This PR only adds type/constant registration. The actual provider module (avian.ts), env var (AVIAN_API_KEY), and chat completions routing are not included and would need to be added in a follow-up PR for these models to actually work end-to-end.

Models

Model Notes
avian/deepseek-v3.2 DeepSeek V3 (0324)
avian/kimi-k2.5 Moonshot Kimi K2.5
avian/glm-5 Zhipu GLM-5
avian/minimax-m2.5 MiniMax M2.5

Add Avian (api.avian.io) as a new OpenAI-compatible inference provider with
four models: DeepSeek V3.2, Kimi K2.5, GLM-5, and MiniMax M2.5.

Changes:
- New provider module (web/src/llm-api/avian.ts) with streaming and
  non-streaming support, per-model pricing, usage tracking, and billing
- Route avian/* models through the Avian provider in chat completions API
- Add AVIAN_API_KEY to server env schema
- Register avian models in model-config constants and agent type definitions

hiSandog commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

One thing I'd double-check before merging: web/src/llm-api/avian.ts currently bills as soon as any streamed chunk contains usage. In this repo, the newer provider implementations in web/src/llm-api/canopywave.ts and web/src/llm-api/siliconflow.ts added a billedAlready + isFinalChunk(...) guard because some providers emit cumulative usage on non-final chunks or can repeat a terminal usage frame.

Without that guard here, Avian could insert duplicate BigQuery rows and consume credits more than once for the same response. I'd be inclined to copy the CanopyWave/SiliconFlow pattern and strip usage from non-final chunks before forwarding them to the SDK.

@avianion

avianion commented Apr 9, 2026

Copy link
Copy Markdown
Author

Addressed feedback: added billedAlready + isFinalChunk() guard to prevent duplicate BigQuery rows and credit charges. Follows the same pattern used in canopywave.ts and siliconflow.ts — usage is now stripped from non-final chunks and billing only triggers once on the final chunk with finish_reason.

@avianion

avianion commented May 7, 2026

Copy link
Copy Markdown
Author

Resolved merge conflicts with latest upstream main.

@avianion

Copy link
Copy Markdown
Author

Addressed feedback: switched to using getProviderApiKey helper.

1 similar comment
@avianion

Copy link
Copy Markdown
Author

Addressed feedback: switched to using getProviderApiKey helper.

@avianion

Copy link
Copy Markdown
Author

Resolved merge conflicts with latest upstream.

@codebuff-team

Copy link
Copy Markdown
Contributor

Thanks for the contribution, but this falls under "adding a vendor," which is a product-direction decision the maintainers make, not something to introduce unilaterally via a PR — regardless of how clean the wiring is.

Separately, the diff itself doesn't match the PR description. The body claims a new web/src/llm-api/avian.ts provider module with streaming/non-streaming support, TTFT tracking, error handling, an AVIAN_API_KEY env var, and routing of avian/* chat completions — none of that appears in the actual diff. All that's here is the type/constant registration (ModelName, avianModels, providerModelNames, providerDomains). Without the actual provider implementation, these three files alone would break at runtime: avian/* models would be recognized as valid ModelNames and show up in provider metadata, but there's no code path to actually call the Avian API, so requests would fail or fall through incorrectly.

Also worth flagging: the diff sneaks in ...openCodeZenModels into the models spread in model-config.ts, which is unrelated to Avian and not mentioned anywhere in the PR description — this suggests the diff was generated from a messier branch state than what's described.

Finally, several of the listed models (kimi-k2.5, glm-5, minimax-m2.5) don't correspond to any models I'm aware of being publicly available — please double check these are real, shippable model IDs and not placeholders.

If you want to pursue this, it would need: the actual provider module, env schema entry, and chat-completions routing all in the same PR, and it would still need sign-off on adding a new vendor before it's actionable.

@codebuff-team codebuff-team added bot:triaged Classified by the community triage bot pr:out-of-scope Touches paths the public mirror does not accept labels Aug 19, 2026
@avianion

Copy link
Copy Markdown
Author

Thanks for the detailed review. Addressed the concrete issues:

  1. Removed ...openCodeZenModels spread — that was an unrelated change that leaked in from the branch state. Removed in the latest commit.

  2. Updated PR description — now accurately reflects what the diff contains: type/constant registration only. The previous description was written for a larger changeset that didn't survive the merge conflicts. The provider module, env var, and routing would need a follow-up PR.

  3. Model IDs — these are real, publicly available models served via Avian's API:

    • kimi-k2.5 — Moonshot's Kimi K2.5
    • glm-5 — Zhipu's GLM-5
    • minimax-m2.5 — MiniMax M2.5

Understood that adding a new vendor is a product-direction decision. Happy to close this if the team decides against it.

@codebuff-team codebuff-team added the stale No activity after a maintainer request; queued for closing label Aug 22, 2026
@codebuff-team

Copy link
Copy Markdown
Contributor

Marking this stale - there has been no activity here for 140 days. It will close in 7 days unless someone comments.

This is backlog upkeep, not a verdict on the pull request. A single comment keeps it open, and anything closed this way can be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:triaged Classified by the community triage bot pr:out-of-scope Touches paths the public mirror does not accept stale No activity after a maintainer request; queued for closing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants